// 静态路由 - 动态路由全放在 layout 的 children 下
export const staticRouter = [
  {
    path: '/',
    // redirect: '/todoList'
    redirect: '/layout'
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue'),
    meta: { title: '登录页' }
  },
  {
    path: '/layout',
    name: 'layout',
    component: () => import('@/views/layout/index.vue'),
    redirect: '/system/user',
  }
]

// 报错路由 -- 删掉能解决这个警告：
/**
 * vue-router.js?v=a73d4676:204 [Vue Router warn]: Discarded invalid param(s) "pathMatch" when navigating. 
 * See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.
 */
export const errorRouter = [
  {
    path: '/403',
    name: '403',
    component: () => import('@/views/ErrorMessage/403.vue'),
    meta: { title: '403页面' }
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/ErrorMessage/404.vue'),
    meta: { title: '404页面' }
  }
]

// 最终匹配路由 - 在动态路由后加入路由表
export const notFoundRouter = {
  path: '/:pathMatch(.*)*',
  name: 'notFound',
  redirect: { name: '404' }
}
